package wsi.gui.pref;

import java.awt.GridBagConstraints;
import java.awt.Insets;

import org.rygh.gui.swing.field.SDoubleField;
import org.rygh.gui.swing.field.SIntegerField;
import org.rygh.gui.swing.view.SGridView;

import wsi.script.AppConfig;

@SuppressWarnings("serial")
public class PrefParameterView extends SGridView {

	public PrefParameterView() {
		initComponents();
	}

	private void initComponents() {
		GridBagConstraints c;
		SIntegerField ifield;
		SDoubleField dfield;

		AppConfig config = AppConfig.shared();

		ifield = new SIntegerField("Input Size");
		ifield.setEditable(false);
		ifield.setValue(config.getInputSize());

		c = new GridBagConstraints();
		c.gridx = 0;
		c.gridy = 0;
		c.anchor = GridBagConstraints.LINE_END;
		add(ifield.getLongView(), c);

		dfield = new SDoubleField("Functionality Threshold");
		dfield.setEditable(false);
		dfield.setValue(config.getFunctionalityThreshold());

		c = new GridBagConstraints();
		c.gridx = 0;
		c.gridy = 1;
		c.anchor = GridBagConstraints.LINE_END;
		c.insets = new Insets(6, 0, 0, 0);
		add(dfield.getLongView(), c);
	}
}
